<script lang="ts" setup>
import { ref, onMounted } from 'vue'
import UploadPlug from './uploadPlugin'

const clickBtn = () => {
    const uploadPlug = new UploadPlug()
    uploadPlug.localUpload({
        // type: ['jpg', 'png'],
        // size: 80,
        camera: true,
        isCompress: true,
        compressQuality: 0.5,
        callback: (res: any) => {
            // debugger;
            console.log(123, res)
            const { successList } = res
            const img = successList[0].base64Url
            // 打开新窗口
            const newWindow = window.open('', '_blank')
            newWindow?.document.write(`<img src="${img}" />`)
        },
    })
}
</script>

<template>
    <div>
        <el-button type="primary" @click="clickBtn">按钮</el-button>
    </div>
</template>

<style scoped lang="scss"></style>
